<div class="pull-left">
  <h4>Contacts</h4>
</div>
<div class="pull-right">
  <%= link_to 'Add new contact', new_driver_contact_path(@driver), :class => 'btn btn-mini btn-primary' %>
</div>
<table class="table table-bordered">
  <thead>
    <tr>
      <th>Default</th>
      <th>Contact type</th>
      <th> Mobile </th>
      <th> Telephone </th>
      <th> Email </th>
      <th> Fax </th>
      <th> Action </th>
    </tr>
  </thead>
  <tbody>
    <% @driver.contacts.each do |contact| %>
    <tr>
      <td> <% if @driver.default_contact_id == contact.id %> <span class="label label-success">Default</span> <% end %> </td>
      <td> <%= contact.contact_type.name %> </td>
      <td> <%= contact.contact_no_mobile %> </td>
      <td> <%= contact.contact_no_telephone %> </td>
      <td> <%= contact.email %> </td>
      <td> <%= contact.fax_no %> </td>
      <td> <%= link_to 'Edit', edit_driver_contact_path(@driver, contact), :class => 'btn btn-mini btn-primary' %>
      <%= link_to 'Remove', driver_contact_path(@driver, contact), :confirm => 'Are you sure?', :method => :delete, :class => 'btn btn-mini btn-danger' %> </td>
    </tr>
    <% end %>
  </tbody>
</table>